//
//  UIImage+Extension.m
//  百思不得姐
//
//  Created by qianfeng on 16/3/7.
//  Copyright © 2016年 高炜. All rights reserved.
//

#import "UIImage+Extension.h"

@implementation UIImage (Extension)
-(UIImage *)cycleImage
{
    UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0);
    
    CGContextRef contex= UIGraphicsGetCurrentContext();
    CGRect rect =CGRectMake(0, 0, self.size.width, self.size.height);
    CGContextAddEllipseInRect(contex, rect);
    CGContextClip(contex);
    [self drawInRect:rect];
    UIImage *image =UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}
@end
